package com.bawei.base

import android.app.Application
import com.alibaba.android.arouter.launcher.ARouter
import com.tencent.mmkv.MMKV
import io.microshow.rxffmpeg.RxFFmpegInvoke

/**
 * Author: Jason Zhang
 * Date: 2024/9/11
 * Desc:
 */
open class BaseApplication: Application() {

    companion object {
        lateinit var appContext: BaseApplication
    }

    override fun onCreate() {
        appContext = this

        //初始化MMKV
        MMKV.initialize(this)

        //只有当在debug模式下才打开日志
        if (BuildConfig.DEBUG){
            ARouter.openLog()
            ARouter.openDebug()
        }

        //初始化ARouter
        ARouter.init(this)

        //RxFFmpeg的Debug模式
        if (BuildConfig.DEBUG){
            RxFFmpegInvoke.getInstance().setDebug(true)
        }

        super.onCreate()
    }

    override fun onLowMemory() {
        super.onLowMemory()
    }


}